<template>
	<view>
		<u-navbar :is-back="isBack" :title="title" :background="backgrounds" :title-color="textColor" title-size="38rpx"
			:border-bottom="false" :custom-back="back" :back-icon-color="textColor" :back-text="backTitle"
			:back-text-style="backColor"></u-navbar>
	</view>
</template>

<script>
	export default {
		name: "q-navbar",
		props: {
			title: {
				type: String,
				default: ''
			},
			backTitle: {
				type: String,
				default: ''
			},
			isBack: {
				type: Boolean,
				default: true
			},
			Color: {
				type: String,
				default: '#e9eef7'
			},
			textColor: {
				type: String,
				default: '#fff'
			},
			backgrounds: {
				type: Object,
				default: function() {
					return {
						backgroundColor: '#11B8A6'
					}
				}
			},
			backColor: {
				type: Object,
				default: function() {
					return {
						color: '#fff'
					}
				}
			},
			backUrl: {
				type: String,
				default: ''
			}
		},
		data() {
			return {

			};
		},
		methods: {
			back() {
				if (this.$u.test.isEmpty(this.backUrl)) {
					uni.navigateBack({
						url: this.backUrl
					})
				} else {
					// if (this.backUrl == 'data') {
					// 	uni.switchTab({
					// 		url: '/pages/data/index'
					// 	});
					// } else if (this.backUrl == 'index') {
					// 	uni.switchTab({
					// 		url: 'pages/index/index'
					// 	})
					// } else {
					uni.navigateBack({
						url: this.backUrl
					})
					// }
				}
			}
		}
	}
</script>

<style>

</style>
